package com.zone.demo.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created with IntelliJ IDEA.
 * User: SJP
 * Date: 2021/7/8
 * Time: 20:30
 *
 * @author sjp
 * Description: 获取Data类型的系统时间
 */
public class CurrentTime {
    public Date getCurrentTime(){
        Date date = new Date();
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            try {
               return df.parse(df.format(date));
            } catch (ParseException e) {
                e.printStackTrace();
            }
        return null;
    }
}
